package cn.vc.auth.service.impl;

import cn.vc.auth.mapper.PermissionMapper;
import cn.vc.auth.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author mo
 * @Description:
 * @日期: 2024-04-02 22:31
 **/
@Service
public class PermissionServiceImpl implements PermissionService {

    @Autowired
    private PermissionMapper permissionMapper;

    @Override
    public List<String> selectPermissionByUserId(Long userId) {
        List<String> codes = permissionMapper.selectCodeByUserId(userId);
        List<String> permissions = new ArrayList<>();
        codes.forEach(code -> {
            permissions.add(code.toString());
        });
        return permissions;
    }

}
